//常量
export default {
  layout: {
    wHeight: '100vh',
    mHeight: 920 / 3,
    aHeight: 250
  },

  // PM10 PM2.5
  weather: {
    pm10: 0,
    pm25: 0,
    quality: '无',
  },

  // 统计数据（工地总数，设备总数，黄色预警次数，红色预警次数）
  engCount: 0,
  equipmentCount: 0,
  yellowAlertCount: 0,
  redAlertCount: 0,

  alertHistoryLastDay: {
    title: {
      text: '预警历史'
    },
    // backgroundColor: 'rgba(128, 128, 128, 0.5)',
    color: ['#FFD700', '#FF0000'],
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data:['黄色预警','红色预警']
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['8-5','8-6','8-7','8-8','8-9','8-10','8-11','8-12','8-13','8-14']
    },
    yAxis: {
      type: 'value',
      axisLabel: {
        formatter: '{value}次'
      }
    },
    series: [
      {
        name:'黄色预警',
        type:'line',
        data:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      },
      {
        name:'红色预警',
        type:'line',
        data:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      },
    ]
  },

  // 预警次数排名(order by 红色>黄色>累计处理)
  alertCountRank: {
    jsxcolumns: [
      { dataKey: 'ename', title: '设备名称', width: '40%' },
      { dataKey: 'yellow', title: '黄色预警', width: '20%' },
      { dataKey: 'red', title: '红色预警', width: '20%' },
      { dataKey: 'handlestatus', title: '累计处理', width: '20%' },
    ],
    jsxdata: {
      data: [],
    },
  },

  alertDetails: {
    data: []
  },

  equipmentAllInfo: {
    search: {
      page: 1,
      size: 10,
      ename: '',
    },
    jsxcolumns: [
      {dataKey: 'ename', title: '设备名称', width: 90},
      {dataKey: 'pmTwo', title: 'PM2.5(μg/m³)', width: 95, ordered: true},
      {dataKey: 'pmTen', title: 'PM10(μg/m³)', width: 95, ordered: true},
      {dataKey: 'tsp', title: '噪音(dB)', width: 75},
      {dataKey: 'temperature', title: '温度(℃)', width: 80},
      {dataKey: 'humidity', title: '湿度(%)', width: 80},
      {dataKey: 'windSpeed', title: '风速(M/S)', width: 90},
      {
        dataKey: 'windDeriction', title: '风向', width: 72,
        render: (windDeriction) => {
          let orientation="";
          if(windDeriction > 337.5 || (windDeriction <= 22.5 && windDeriction >= 0)){
            orientation="北";
          }
          else if(windDeriction > 22.5 && windDeriction <= 67.5){
            orientation="东北";
          }
          else if(windDeriction > 67.5 && windDeriction <= 112.5){
            orientation="东";
          }
          else if(windDeriction > 112.5 && windDeriction <= 157.5){
            orientation="东南";
          }
          else if(windDeriction > 157.5 && windDeriction <= 202.5){
            orientation="南";
          }
          else if(windDeriction > 202.5 && windDeriction <= 247.5){
            orientation="西南";
          }
          else if(windDeriction > 247.5 && windDeriction <= 292.5){
            orientation="西";
          }
          else if(windDeriction > 292.5 && windDeriction <= 337.5){
            orientation="西北";
          }
          else{
            orientation="未知";
          }
          return orientation;
        }
      },
      {dataKey: 'atmosphere', title: '气压(Pa)', width: 90},
      {
        dataKey: 'reportFrequent', title: '雾炮', width: 80,
        render: (reportFrequent) => {
          switch (reportFrequent) {
            case '1':
              return '关闭';
              break;
            case '2':
              return '开启';
              break;
            case '3':
              return '异常';
              break;
            default:
              return '未知';
              break;
          }
        }
      },
      {
        dataKey: 'sprinklestatus', title: '喷淋', width: 75,
        render: (sprinklestatus) => {
          switch (sprinklestatus) {
            case '1':
              return '关闭';
              break;
            case '2':
              return '开启';
              break;
            case '3':
              return '异常';
              break;
            default:
              return '未知';
              break;
          }
        }
      }
    ],
    jsxdata: {
      data: [],
      currentPage: 1,
      totalCount: 0
    }
  }

}
